package com.telecomyt.jwportal.activity.voice;

import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;
import android.view.View;
import android.widget.Chronometer;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.telecomyt.jwportal.R;
import com.telecomyt.jwportal.base.BaseActivity;
import com.telecomyt.jwportal.base.BasePresenter;

import butterknife.BindView;
import butterknife.OnClick;

public class VoiceActivity extends BaseActivity {


    @BindView(R.id.mImageView)
    ImageView mImageView;
    @BindView(R.id.mImageHead)
    ImageView mImageHead;
    @BindView(R.id.mChronometer)
    Chronometer mChronometer;
    @BindView(R.id.mTvRecord)
    TextView mTvRecord;
    @BindView(R.id.mTvLoudspeaker)
    TextView mTvLoudspeaker;
    @BindView(R.id.mTvMute)
    TextView mTvMute;
    @BindView(R.id.mTvHangup)
    TextView mTvHangup;
    @BindView(R.id.mLinearLayout)
    LinearLayout mLinearLayout;

    public static void start(Context context) {
        Intent starter = new Intent(context, VoiceActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_voice;
    }

    @Override
    protected void initView() {
        mChronometer.setBase(SystemClock.elapsedRealtime());//计时器清零
        int hour = (int) ((SystemClock.elapsedRealtime() - mChronometer.getBase()) / 1000 / 60);
        mChronometer.setFormat("0" + hour + ":%s");
        mChronometer.start();
    }

    @Override
    protected void initData() {

    }

    @Override
    protected BasePresenter creatPresenter() {
        return null;
    }


    @OnClick({R.id.mTvRecord, R.id.mTvLoudspeaker, R.id.mTvMute, R.id.mTvHangup})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.mTvRecord:
                break;
            case R.id.mTvLoudspeaker:

                break;
            case R.id.mTvMute:

                break;
            case R.id.mTvHangup:
                finish();
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mChronometer.stop();
    }
}